// 浮点数排序

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>

#define EPSILON 0.0000001
using namespace std;

int n;
double num[105];

double ff(double a){
    double a_b = fabs(a - (int)a);
    double a_u = fabs((int)a + 1 - a);
    double a_f = min(a_b, a_u);
    return a_f;
}

bool cmp(double a, double b) {
    double a_f = ff(a);
    double b_f = ff(b);

    if(fabs(a_f - b_f) < EPSILON) {
        return a < b;
    }

    return a_f < b_f;
}

int main() {
    cin >> n;
    for(int i = 0; i < n; i++) {
        cin >> num[i]; 
    }

    sort(num, num+n, cmp);

    for(int i = 0; i < n; i++){ 
        printf("%.6lf ", num[i]);
    }

    cout << '\n';

    return 0;
}